﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace cludg.Infrastructure.DI
{
	public interface IDIContainer
	{
		void Register(Type impl, DILifetime lifetime, params object[] constructorParams);
		void Register(Type intf, Type impl, string name, DILifetime lifetime, params object[] constructorParams);
		void RegisterInstance(Type intf, object instance, string name);

		object Resolve(Type intf, string name);
		IEnumerable<object> ResolveAll(Type intf);
	}

	public enum DILifetime
	{
		PerResolve,
		PerThread,
		Singleton
	}
}
